package com.syt.cmn.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.syt.cmn.easyexcel.UserData;

import java.util.Map;

/**
 * @Author: xxx
 * @Date: 2023/2/5 20:08
 * @Description: 监听器
 */
public class ExcelListener extends AnalysisEventListener<UserData> {
    
    /*
    *  一行一行读取excel内容，从第二行读取
    * */
    
    @Override
    public void invoke(UserData data, AnalysisContext context) {
        System.out.println(data);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息="+headMap);
    }
    
    //读取之后执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
       
    }
}
